package com.copa.l2185;

/**
 * @author copa
 * @createDate 2023-01-08 17:24
 * @function API调用法
 */
public class Test1 {

    public int prefixCount(String[] words, String pref) {
        int count = 0;
        for (String word : words) {
            if (word.startsWith(pref)) {
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        String[] words = {"pay", "attention", "practice", "attend"};
        String pref = "at";
        System.out.println(new Test1().prefixCount(words, pref));
    }
}
